package xyz.lisys.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import xyz.lisys.model.UserArgs;

@Controller("playAction")
@Scope("prototype")
public class PlayAction extends ActionSupport implements ModelDriven<UserArgs> {

    private UserArgs user = new UserArgs();

    public String view() {
        // 测试ModelDriven入参内容
        System.out.println(user.name);
        return SUCCESS;
    }

    @Override
    public UserArgs getModel() {
        return user;
    }

    public UserArgs getUser() {
        return user;
    }

    public void setUser(UserArgs user) {
        this.user = user;
    }
}
